<!--
 * @FilePath     : /study_code/jquery/index.html
 * @Description  : .queue()
 * @Date         : 2025-04-16 15:27:38
 * @Author       : Fang YingGui
 * @LastEditors  : fangyinggui 18715384437@163.com
 * @LastEditTime : 2025-04-16 15:29:03
-->
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>documentName</title>
    <style>
      div {
        margin: 3px;
        width: 40px;
        height: 40px;
        position: absolute;
        left: 0px;
        top: 30px;
        background: green;
        display: none;
      }
      div.newcolor {
        background: blue;
      }
      span {
        color: red;
      }
    </style>
  </head>
  <body>
    <button id="show">Show Length of Queue</button>
    <span></span>
    <div></div>

    <script src="/jquery/dist/jquery.min.js"></script>
    <script>
      $('#show').click(function () {
        var n = $('div').queue('fx')
        console.log(1, 'queue 返回值', n) // {Object}
        $('span').text('Queue length is: ' + n.length)
      })
      function runIt() {
        $('div').show('slow')
        $('div').animate({ left: '+=200' }, 2000)
        $('div').slideToggle(1000)
        $('div').slideToggle('fast')
        $('div').animate({ left: '-=200' }, 1500)
        $('div').hide('slow')
        $('div').show(1200)
        $('div').slideUp('normal', runIt)
      }
      runIt()
    </script>
  </body>
</html>
